package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.List;
import java.util.Objects;

@Entity
@Table(name = "purchase_", schema = "boot", catalog = "")
public class Purchase {//采购表
    private int purchaseId;//采购id
    private String purchaseName;//采购主题
    private String purchaseOrder;//采购单号
    private Date purchaseTime;//采购时间
    private Supplier supplierId;//供应商id
    private SupplierContact supcontactId;//供应商联系人
    private BigDecimal purchaseMoney;//采购金额
    private String purchaseStatus;//审核状态
    private String purchaseMan;
    private Integer purchaseSc;//是否删除

    @Id
    @Column(name = "purchase_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getPurchaseId() {
        return purchaseId;
    }

    public void setPurchaseId(int purchaseId) {
        this.purchaseId = purchaseId;
    }

    @Basic
    @Column(name = "purchase_name")
    public String getPurchaseName() {
        return purchaseName;
    }

    public void setPurchaseName(String purchaseName) {
        this.purchaseName = purchaseName;
    }

    @Basic
    @Column(name = "purchase_order")
    public String getPurchaseOrder() {
        return purchaseOrder;
    }

    public void setPurchaseOrder(String purchaseOrder) {
        this.purchaseOrder = purchaseOrder;
    }

    @Basic
    @Column(name = "purchase_time")
    public Date getPurchaseTime() {
        return purchaseTime;
    }

    public void setPurchaseTime(Date purchaseTime) {
        this.purchaseTime = purchaseTime;
    }

    @ManyToOne
    @JoinColumn(name = "supplier_id", referencedColumnName = "supplier_id")
    public Supplier getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Supplier supplierId) {
        this.supplierId = supplierId;
    }

    @ManyToOne
    @JoinColumn(name = "supcontact_id", referencedColumnName = "supcontact_id")
    public SupplierContact getSupcontactId() {
        return supcontactId;
    }

    public void setSupcontactId(SupplierContact supcontactId) {
        this.supcontactId = supcontactId;
    }

    @Basic
    @Column(name = "purchase_money")
    public BigDecimal getPurchaseMoney() {
        return purchaseMoney;
    }

    public void setPurchaseMoney(BigDecimal purchaseMoney) {
        this.purchaseMoney = purchaseMoney;
    }

    @Basic
    @Column(name = "purchase_man")
    public String getPurchaseMan() {
        return purchaseMan;
    }

    public void setPurchaseMan(String purchaseMan) {
        this.purchaseMan = purchaseMan;
    }

    @Basic
    @Column(name = "purchase_status")
    public String getPurchaseStatus() {
        return purchaseStatus;
    }

    public void setPurchaseStatus(String purchaseStatus) {
        this.purchaseStatus = purchaseStatus;
    }

    @Basic
    @Column(name = "purchase_sc")
    public Integer getPurchaseSc() {
        return purchaseSc;
    }

    public void setPurchaseSc(Integer purchaseSc) {
        this.purchaseSc = purchaseSc;
    }

    @Override
    public String toString() {
        return "Purchase{" +
                "purchaseId=" + purchaseId +
                ", purchaseName='" + purchaseName + '\'' +
                ", purchaseOrder='" + purchaseOrder + '\'' +
                ", purchaseTime=" + purchaseTime +
                ", supplierId=" + supplierId +
                ", supcontactId=" + supcontactId +
                ", purchaseMoney=" + purchaseMoney +
                ", purchaseStatus='" + purchaseStatus + '\'' +
                ", purchaseSc=" + purchaseSc +
                '}';
    }
}
